package o;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.Param;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.c;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.d;
import com.huawei.appmarket.service.activitydispatcher.OpenGateway.e;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class dpf extends e {
    private static final Map<String, d> ॱ = new HashMap();

    public static void ˋ(String str) {
        ॱ.put(str, null);
    }

    public static void ˏ(String str, d dVar) {
        ॱ.put(str, dVar);
    }

    private static Intent ˊ(String str, List<Param> list) {
        Class cls;
        try {
            cls = Class.forName(str);
        } catch (ClassNotFoundException e) {
            cls = null;
        }
        if (cls == null) {
            return null;
        }
        Intent intent = new Intent(ContentManager.getInstant().getContext(), cls);
        Logger.ˎ("ActivityNameProvider", "createIntent, activity:" + str);
        if (list == null || list.size() <= 0) {
            return intent;
        }
        Bundle bundle = new Bundle();
        if (e.ˎ((List) list, bundle)) {
            intent.putExtras(bundle);
            return intent;
        }
        Logger.e("ActivityNameProvider", "param error.");
        return null;
    }

    public c ˋ(String str, List<Param> list, boolean z) {
        if (TextUtils.isEmpty(str)) {
            Logger.e("ActivityNameProvider", "can not find activityName");
            return null;
        } else if (!z || ॱ.containsKey(str)) {
            List ॱ;
            d dVar = (d) ॱ.get(str);
            if (dVar != null) {
                ॱ = dVar.ॱ(list);
            }
            if (!z || dVar == null || dVar.ˋ(ॱ)) {
                if (dVar != null) {
                    fjb ˏ = dVar.ˏ(ॱ);
                    if (ˏ != null) {
                        c cVar = new c();
                        c.c cVar2 = new c.c();
                        cVar2.ˋ = ˏ;
                        cVar.ˋ(cVar2);
                        return cVar;
                    }
                }
                c cVar3 = new c();
                Intent ˊ = ˊ(str, ॱ);
                if (dVar != null) {
                    dVar.ˋ(ˊ);
                }
                cVar3.ˋ(ˊ);
                return cVar3;
            }
            Logger.ˎ("ActivityNameProvider", "param limited.");
            return null;
        } else {
            Logger.ˎ("ActivityNameProvider", "activityName limited.");
            return null;
        }
    }
}
